<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>赞活动配置管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/wechat/praise/praiseActivityConfig/">赞活动配置列表</a></li>
		<li class="active"><a href="${ctx}/wechat/praise/praiseActivityConfig/form?id=${praiseActivityConfig.id}">赞活动配置<shiro:hasPermission name="wechat:praise:praiseActivityConfig:edit">${not empty praiseActivityConfig.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="wechat:praise:praiseActivityConfig:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="praiseActivityConfig" action="${ctx}/wechat/praise/praiseActivityConfig/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<tags:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">名称:</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="11" class="required"/>
			</div>
		</div>
		
		
		<div class="control-group">
			<label class="control-label">是否开启:</label>
			<div class="controls">
				<input type="radio" name="startup" value="true" <c:if test="${shareConfig.startup eq true }">  checked="checked" </c:if> /> 是   <input type="radio" name="startup" value="false" <c:if test="${shareConfig.startup eq false }">  checked="checked" </c:if> /> 否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否允许重复:</label>
			<div class="controls">
				<input type="radio" name="repeats" value="true" <c:if test="${shareConfig.repeats eq true }">  checked="checked" </c:if> /> 是   <input type="radio" name="repeats" value="false" <c:if test="${shareConfig.repeats eq false }">  checked="checked" </c:if> /> 否
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">是否增加积分:</label>
			<div class="controls">
				<input type="radio" name="addScore" value="true" <c:if test="${shareConfig.addScore eq true }">  checked="checked" </c:if> /> 是   <input type="radio" name="addScore" value="false" <c:if test="${shareConfig.addScore eq false }">  checked="checked" </c:if> /> 否
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">转发获得积分:</label>
			<div class="controls">
				<form:input path="score" htmlEscape="false" maxlength="3" class=""/>
			</div>
		</div>
		
		
		
		
		<div class="control-group">
			<label class="control-label">中奖有效天数:</label>
				<div class="controls">
				<select name="validDays" id="validDays"  >
					<% for(int i=1;i<31;i++) {%>
					<option value="<%=i %>" ><%=i %>天</option>
					<%} %>
				</select>
			</div>
		</div>
		
		
		<div class="control-group">
			<label class="control-label">中奖回复内容:</label>
			<div class="controls">
				<form:textarea path="awardReply" htmlEscape="false" cols="10" rows="5" />    <br><br><div class="alert alert-error"><strong>上传中奖后的回复内容，其中 "%奖名%","%名次%","%期限%"是动态变量。<br> 如:恭喜您获得了微圈分享中奖活动的"+"%奖品%"+",你是第%名次%位分享微圈的人，请于%期限%日内到店里使用,过期作废，谢谢！</strong></div>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">默认回复内容:</label>
			<div class="controls">
				<form:textarea path="defaultReply" htmlEscape="false" cols="10" rows="5" />   
				 <br><br><div class="alert alert-error"><strong>上传后的默认回复内容其中 "%奖名%","%名次%","%期限%"是动态变量。<br> 如:恭喜您获得了微圈分享中奖活动的"+"%奖品%"+",你是第%名次%位分享微圈的人，请于%期限%日内到店里使用,过期作废，谢谢！</strong></div>
			</div>
		</div>
		
		
		<div class="control-group">
			<label class="control-label">备注:</label>
			<div class="controls">
				<form:input path="remarks" htmlEscape="false" maxlength="50" />
			</div>
		</div>
		
		
		<div class="form-actions">
			<shiro:hasPermission name="wechat:praise:praiseActivityConfig:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>
